<template>
  <h2>标题</h2>
  <h3>{{ person.name }}</h3>
  <h3>{{ person.age }}</h3>
  <button @click="plant">fasong</button>
  <slot name="school"></slot>
  <br>
  <span>{{person.fullName}}</span>
</template>

<script>
import{reactive,computed} from 'vue'
export default {
  name: "Demo",
  components: {},
  props:['msg'],
  setup(props,context) {
    console.log(props.msg)//proxy
    console.log(context.attrs.text)
    console.log(context.slots)
    let person = reactive({
      name: "前端",
      age: "30",
    });
    person.fullName = computed(()=>{
        return person.name+'-'+person.age
    })
    function plant(){
        console.log('demo plant')
        context.emit('plant','zombie')
    }

    return {
      person,plant
    };
  },
};
</script>

<style>
</style>
